package com.nineclock.common.exception;

import com.nineclock.common.enums.ResponseEnum;
import lombok.Data;

/**
 * @author yangchao
 * @create 2022-01-14 14:05
 **/
@Data
public class CheckCodeException extends RuntimeException{

    private Integer code;

    public CheckCodeException(ResponseEnum responseEnum){
        super(responseEnum.getMessage());
        this.code = responseEnum.getCode();
    }

    public CheckCodeException(ResponseEnum responseEnum, Throwable throwable){
        super(responseEnum.getMessage(), throwable);
        this.code = responseEnum.getCode();
    }

    public CheckCodeException(ResponseEnum responseEnum,String info){
        super((info));
        this.code = responseEnum.getCode();
    }

}
